﻿@model scheduleMVC.Models.TasksModel

@{
    ViewBag.Title = "Create";
    SelectListItem[] CustomerNames = ViewBag.Customers;    
    SelectListItem[] EmployeeNames = ViewBag.Employees;
    SelectListItem[] TasksPrio = ViewBag.TasksPriorities;
    SelectListItem[] TasksStat = ViewBag.TasksStatus;
    

}
    <h2>Create</h2>
    

    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()

        <div class="form-horizontal">
            <h4>TasksModel</h4>
            <hr />
            @Html.ValidationSummary(true)

            

            <div class="form-group">
                @Html.LabelFor(model => model.Name, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    @Html.EditorFor(model => model.Name)
                    @Html.ValidationMessageFor(model => model.Name)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Priority, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    @Html.DropDownList("Priority", TasksPrio)
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.Status, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    @Html.DropDownList("Status", TasksStat)
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.Complete, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    @Html.EditorFor(model => model.Complete)
                    @Html.ValidationMessageFor(model => model.Complete)
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.Employee_ID, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    @Html.DropDownList("Employee_ID", EmployeeNames)

                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.CustomerID, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    @Html.DropDownList("CustomerID", CustomerNames)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.Description, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    @Html.TextAreaFor(model => model.Description)
                    @Html.ValidationMessageFor(model => model.Description)
                </div>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.StartDate, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    @Html.JQueryUI().DatepickerFor(model => model.StartDate).MinDate(DateTime.Now)
                    @Html.ValidationMessageFor(model => model.StartDate)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.DueDate, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                 @Html.JQueryUI().DatepickerFor(model => model.DueDate).MinDate(DateTime.Now)
                    @Html.ValidationMessageFor(model => model.DueDate)

                </div>
            </div>
           


            <div class="form-group">
                @Html.LabelFor(model => model.AssignementDate, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    @Html.JQueryUI().DatepickerFor(model => model.AssignementDate).MinDate(DateTime.Now)
                    @Html.ValidationMessageFor(model => model.AssignementDate)
                    
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.CreationDate, new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    @Html.JQueryUI().DatepickerFor(model => model.CreationDate)
                    @Html.ValidationMessageFor(model => model.CreationDate)
                    
                </div>
            </div>

            
            <div class="form-group">
                @Html.Label("Attach file", new { @class = "control-label col-md-2" })
                <div class="col-md-110">
                    <input type="file" id="fileUpload" name="fileUpload" size="23" />
      
                </div>
            </div>
            
            <p>
               
            </p>
            <p>
                
            </p> 

       

            <div class="form-group">
                <div class="col-md-offset-2 col-md-10">
                    @Html.JQueryUI().Button("Create")
                    @*@Html.JQueryUI().Button("Create",new { id = "triggerButton"*@ 
                    @*<input type="submit" value="Create" class="btn btn-default" />*@
                </div>
            </div>
        </div>

    @*<div>
        @using (Html.JQueryUI().Begin(new Dialog().AutoOpen(false)
                .TriggerClick("#triggerButton")))
        {
            <p>Uploading your file(s)</p>
            <div>@Html.JQueryUI().Progressbar(null) </div>
        }
    </div>*@

    }

    <div>

        @Html.ActionLink("Back to List", "Index")
    </div>
